package com.anzia.vueblog.blog.controller;


import com.anzia.vueblog.blog.entity.MUser;
import com.anzia.vueblog.blog.service.MUserService;
import com.anzia.vueblog.common.lang.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Anzia.
 * @since 2021-04-24
 */
@RestController
public class MUserController {
    @Autowired
    MUserService mUserService;

    //@RequiresAuthentication
    @GetMapping("/index")
    public Result index() {
        MUser user = mUserService.getById(1L);
        return Result.success(user);
    }

    @PostMapping("/save")
    public Result save(@Validated @RequestBody MUser muser) {

        return Result.success(muser);
    }
}

